import requests
from bs4 import BeautifulSoup

def get_page(url, saveName):
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0",
    }

    response = requests.get(url, headers)
    html = response.content.decode()

    path = './pageSave/' + saveName + '.html'
    fw = open(path, 'w', encoding='utf-8')
    fw.write(html)
    fw.close()
    return

if __name__ == '__main__':
    # url = 'https://www.baidu.com'
    url = 'https://www.kuwo.cn/play_detail/271297'
    saveName = 'kuwo'
    get_page(url, saveName)

    # soup = BeautifulSoup(response.content, 'html.parser')
    # print(soup)
